package com.java.escape.NullPointException;

/**
 * @ClassName UnboxingNullPointException
 * @Description 自动拆箱引发的空指针问题
 * @Author wyp
 * @Date 2023/8/22 14:51
 * @Version 1.0
 */
@SuppressWarnings("all")
public class UnboxingNullPointException {
    public static int add(int x, int y) {
        return x + y;
    }

    public static boolean compare(long x, long y) {
        return x >= y;
    }

    public static void main(String[] args) {
        //1. 变量赋值自动拆箱出现的空指针
//        Long count = null;
//        long count_ = count;

//        Integer left = null;
//        Integer right = null;
        //2. 方法传参时自动拆箱引发的空指针
//        add(left, right);
        //3. 比较大小自动拆箱引发的空指针问题
        Long left_ = 10L;
        Long right_ = null;
        compare(left_, right_);
    }


}
